package com.hongdee.crm.contact.mapper;

import com.hongdee.crm.contact.pojo.TCrmConcatVo;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @author zhangkai
 * @desc 一句话描述
 **/
@Mapper
public interface IConcatMapper {
    /**
     * 分页查询
     * @param queryData
     * @param uid
     * @return
     */
    @SelectProvider(type = ConcatSqlProvider.class, method = "query")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "company_name", property = "companyName"),
            @Result(column = "sa_name", property = "saName"),
            @Result(column = "vin", property = "vin"),
            @Result(column = "plate_num", property = "plateNum"),
            @Result(column = "title", property = "title"),
            @Result(column = "content", property = "content"),
            @Result(column = "parent_id", property = "parentId"),
            @Result(column = "type_id", property = "typeId"),
            @Result(column = "owner_name", property = "contactName"),
            @Result(column = "owner_tel", property = "contactPhone"),
            @Result(column = "recordUrl", property = "recordUrl"),
            @Result(column = "brand", property = "brand"),
            @Result(column = "series", property = "series"),
            @Result(column = "next_date", property = "nextDate"),
            @Result(column = "next_content", property = "nextContent"),
            @Result(column = "task_pcode", property = "taskTypePcode"),
            @Result(column = "task_code", property = "taskTypeCcode"),
            @Result(column = "result_a", property = "resultA"),
            @Result(column = "result_b", property = "resultB"),
            @Result(column = "result_c", property = "resultC"),
            @Result(column = "result_d", property = "resultD")

    })

    List<TCrmConcatVo> query(@Param("queryData") Map queryData,@Param("uid") String uid );

    /***
     * 导出车辆维系记录
     * @param queryData
     * @param uid
     * @return
     */
    @SelectProvider(type = ConcatSqlProvider.class, method = "exportQuery")
    @Results({
            @Result(column = "sa_name", property = "saName"),
            @Result(column = "vin", property = "vin"),
            @Result(column = "plate_num", property = "plateNum"),
            @Result(column = "owner_name", property = "contactName"),
            @Result(column = "owner_tel", property = "contactPhone"),
            @Result(column = "brand", property = "brand"),
            @Result(column = "series", property = "series"),
            @Result(column = "content", property = "content"),
    })
    List<TCrmConcatVo> export(@Param("queryData") Map queryData,@Param("uid") String uid );
}
